import Vue from 'vue'
import VueRouter from 'vue-router'

import Layout from '@/layout' //布局页



Vue.use(VueRouter)

// 通用页面, 这里的配置不需要权限
export const constRouter = [
 

  // {
  //   path: 'notice/notice.vue',
  //   component: () => import('@/views/notice/notice.vue'),
  //   name: 'notices',
  //   meta: {
  //     title: "工作台",
  //     icon: 'el-icon-s-home',
     
  //   }
  // },
  {
      path: '',
      component: Layout, //应用布局页
      redirect: '/index',
      hidden: true,
       children: [
        {
          path: '',
          component: () => import('@/views/index/index.vue'),
          name: 'indexs',
          meta: {
            title: "公司门户",
            icon: 'el-icon-s-home',
            roles: ['admin','jerry']
          }
        },
        {
          path: '/personal',
          component: () => import('@/views/personal/personal.vue'),
          name: 'personal',
          meta: {
            title: "个人门户",
            icon: 'el-icon-s-home',
            roles: ['admin','jerry']
          }
        },
        {
          path: '/search',
          component: () => import('@/views/search/search.vue'),
          name: 'search',
          meta: {
            title: "个人门户",
            icon: 'el-icon-s-home',
            roles: ['admin','jerry']
          }
        },
        {
          path: '/sale',
          component: () => import('@/views/sale/sale.vue'),
          name: 'sale',
          meta: {
            title: "销售门户",
            icon: 'el-icon-s-home',
            roles: ['admin','jerry']
          }
        },
        {
          path: '/assistant',
          component: () => import('@/views/assistant/assistant.vue'),
          name: 'assistant',
          meta: {
            title: "助理门户",
            icon: 'el-icon-s-home',
            roles: ['admin','jerry']
          }
        },
        {
          path: '/orderDetail',
          component: () => import('@/views/orderDetail/orderDetail.vue'),
          name: 'orderDetail',
          meta: {
            title: "销售详情",
            icon: 'el-icon-s-home',
            roles: ['admin','jerry']
          }
        },
       
        // {
        //   path: 'notice/notice.vue',
        //   component: Layout,
        //   name: 'notices',
        //   meta: {
        //     title: "工作台",
        //     icon: 'el-icon-s-home',
           
        //   }
        // }
        {
          path: '/notice',
          component: Layout,
          // redirect: '/notice/notice.vue',
          component: () => import('@/views/notice/notice.vue'),
          name: 'notices',
          meta: {
            title: "消息通知",
            icon: 'el-icon-s-home',
           
          }
        },
        {
          path: '/iframe',
          component: Layout,
          // redirect: '/notice/notice.vue',
          component: () => import('@/views/iframe/iframe.vue'),
          name: 'frame',
          meta: {
            title: "平台页面",
            icon: 'el-icon-s-home',
           
          }
        }
    
      ]
  },
  // {
  //     path: '/index',
  //     component: Layout, //应用布局页
      
  //     meta:{
  //         title: "首页", //导航菜单项标题
  //         icon: 'el-icon-s-home' //导航菜单图标
  //     },
  //     children: [
  //       {
  //         path: '',
  //         component: () => import('@/views/index/index.vue'),
  //         name: 'indexs',
  //         meta: {
  //           title: "工作台",
  //           icon: 'el-icon-s-home',
  //           roles: ['admin','jerry']
  //         }
  //       },
        
  //     ]
  // }
]

// 动态路由 communication
export const asyncRoutes = [





]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: constRouter
})

export default router

